﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.Common;
using TianShiProject.Models.Shen.OwnerContracts;
using Volo.Abp.Application.Services;

namespace TianShiProject.Shen.OwnerContracts
{
    public class OwnerContractShenService : ApplicationService
    {
        private readonly IOwnerContractShenRepository _ownerContractRepository;
        public OwnerContractShenService(IOwnerContractShenRepository ownerContractRepository)
        {
            _ownerContractRepository = ownerContractRepository;
        }
        /// <summary>
        /// 提交审批
        /// </summary>
        /// <returns></returns>
        public async Task<int> PostAddOwnerContract(OwnerContractShenDto ownerContractDto, string loginname, int? loginid)
        {
            return await _ownerContractRepository.PostAddOwnerContract(ownerContractDto, loginname, loginid);
        }
        /// <summary>
        /// 显示审批
        /// </summary>
        /// <param name="title"></param>
        /// <param name="danwei"></param>
        /// <param name="fuzeren"></param>
        /// <param name="jingbanren"></param>
        /// <param name="qianding"></param>
        /// <returns></returns>
        public async Task<PageResponse<OwnerContractShenDto>> GetShowOwnerContract(string title, string danwei, string fuzeren, string jingbanren, DateTime? qianding, int pageindex=1, int pagesize=3)
        {
            return await _ownerContractRepository.GetShowOwnerContract(title, danwei,fuzeren, jingbanren, qianding,pageindex,pagesize);
        }
        /// <summary>
        /// 待审批显示
        /// </summary>
        /// <param name="title"></param>
        /// <param name="danwei"></param>
        /// <param name="fuzeren"></param>
        /// <param name="jingbanren"></param>
        /// <param name="qianding"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<OwnerContractShenDto>> GetDaiOwnerContract(string title, string danwei, string fuzeren, string jingbanren, DateTime? qianding, int pageindex=1, int pagesize=3)
        {
            return await _ownerContractRepository.GetDaiOwnerContract(title, danwei, fuzeren, jingbanren, qianding, pageindex, pagesize);
        }
        /// <summary>
        /// 已审批显示
        /// </summary>
        /// <param name="title"></param>
        /// <param name="danwei"></param>
        /// <param name="fuzeren"></param>
        /// <param name="jingbanren"></param>
        /// <param name="qianding"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<OwnerContractShenDto>> GetYiOwnerContract(string title, string danwei, string fuzeren, string jingbanren, DateTime? qianding, int pageindex=1, int pagesize=3)
        {
            return await _ownerContractRepository.GetYiOwnerContract(title, danwei, fuzeren, jingbanren, qianding, pageindex, pagesize);
        }
        /// <summary>
        /// 审批通过
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<int> PutTongOwnerContract(Guid id)
        {
            return await _ownerContractRepository.PutTongOwnerContract(id);
        }
        /// <summary>
        /// 审批拒绝
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<int> PutJuOwnerContract(Guid id)
        {
            return await _ownerContractRepository.PutJuOwnerContract(id);
        }
    }
}
